package com.eastseeway.radioproject.entities;

import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;

import java.io.Serializable;

import struct.StructField;
/**
 * 向文件中保存操作参数
 * 向数据库中保存快捷参数
 * 这两种情况会使用这个类
 */
@Keep
@Entity
public class OperationParams implements Serializable {
    @PrimaryKey
    @NonNull
    String id;
//    位置信息 代表当前快捷参数保存在哪个位置上
    @StructField(order = 0)
    int position;
    String username;
    String time;
    boolean isEmpty = true;
    boolean hasPressure;//带不带负压
    byte freq;
    byte power;
    private byte pressure = 30;
    private int pressurePosition;

    private byte depth;
    private int depthPosition;

    private byte replaceElectrode ;

    private byte intermittentDischargePulse = 10;

    private byte intermittentDischargeHighLevelPeriod = 10;

    private byte intermittentDischargeLowLevelPeriod = 10;

    private short continuousDischargePeriod = 50;//连续放电时间：50-400mS（默认50）
    private int continuousDischargePosition;
    private boolean isIntermittentMode;

    private boolean autoNeedle;//是否自动出针
    private short interval = 1000;//(如果自动出针)间隔：500-1500mS(默认1S)非全功能手柄

    private short shengyucishu;

//    负压手柄
    @Ignore
    public OperationParams(String id, String username,int position, String time, boolean isEmpty, boolean hasPressure, byte freq, byte power, byte pressure, int pressurePosition,byte depth,int depthPosition, byte replaceElectrode,boolean isIntermittentMode, byte intermittentDischargePulse, byte intermittentDischargeHighLevelPeriod, byte intermittentDischargeLowLevelPeriod, short continuousDischargePeriod,int continuousDischargePosition,short shengyucishu) {
        this.id = id;
        this.position = position;
        this.username = username;
        this.time = time;
        this.isEmpty = isEmpty;
        this.hasPressure = hasPressure;
        this.freq = freq;
        this.power = power;
        this.pressure = pressure;
        this.pressurePosition = pressurePosition;
        this.depth = depth;
        this.depthPosition = depthPosition;
        this.isIntermittentMode = isIntermittentMode;
        this.replaceElectrode = replaceElectrode;
        this.intermittentDischargePulse = intermittentDischargePulse;
        this.intermittentDischargeHighLevelPeriod = intermittentDischargeHighLevelPeriod;
        this.intermittentDischargeLowLevelPeriod = intermittentDischargeLowLevelPeriod;
        this.continuousDischargePeriod = continuousDischargePeriod;
        this.continuousDischargePosition = continuousDischargePosition;
        this.shengyucishu = shengyucishu;
    }

//    非负压手柄
    @Ignore
    public OperationParams(String id, String username, int position, String time, boolean isEmpty, boolean hasPressure, byte freq, byte power, byte depth,int depthPosition, byte replaceElectrode,boolean isIntermittentMode, byte intermittentDischargePulse, byte intermittentDischargeHighLevelPeriod, byte intermittentDischargeLowLevelPeriod, short continuousDischargePeriod, int continuousDischargePosition,boolean autoNeedle, short interval, short shengyucishu) {
        this.id = id;
        this.position = position;
        this.username = username;
        this.time = time;
        this.isEmpty = isEmpty;
        this.hasPressure = hasPressure;
        this.freq = freq;
        this.power = power;
        this.depth = depth;
        this.depthPosition = depthPosition;
        this.replaceElectrode = replaceElectrode;
        this.isIntermittentMode = isIntermittentMode;
        this.intermittentDischargePulse = intermittentDischargePulse;
        this.intermittentDischargeHighLevelPeriod = intermittentDischargeHighLevelPeriod;
        this.intermittentDischargeLowLevelPeriod = intermittentDischargeLowLevelPeriod;
        this.continuousDischargePeriod = continuousDischargePeriod;
        this.continuousDischargePosition = continuousDischargePosition;
        this.autoNeedle = autoNeedle;
        this.interval = interval;
        this.shengyucishu = shengyucishu;
    }

    public OperationParams(@NonNull String id, int position, String username, String time, boolean isEmpty, boolean hasPressure, byte freq, byte power, byte pressure, byte depth, int depthPosition,byte replaceElectrode,boolean isIntermittentMode, byte intermittentDischargePulse, byte intermittentDischargeHighLevelPeriod, byte intermittentDischargeLowLevelPeriod, short continuousDischargePeriod, int continuousDischargePosition,boolean autoNeedle, short interval, short shengyucishu) {
        this.id = id;
        this.position = position;
        this.username = username;
        this.time = time;
        this.isEmpty = isEmpty;
        this.hasPressure = hasPressure;
        this.freq = freq;
        this.power = power;
        this.pressure = pressure;
        this.depth = depth;
        this.depthPosition = depthPosition;
        this.replaceElectrode = replaceElectrode;
        this.isIntermittentMode = isIntermittentMode;
        this.intermittentDischargePulse = intermittentDischargePulse;
        this.intermittentDischargeHighLevelPeriod = intermittentDischargeHighLevelPeriod;
        this.intermittentDischargeLowLevelPeriod = intermittentDischargeLowLevelPeriod;
        this.continuousDischargePeriod = continuousDischargePeriod;
        this.continuousDischargePosition = continuousDischargePosition;
        this.autoNeedle = autoNeedle;
        this.interval = interval;
        this.shengyucishu = shengyucishu;
    }

    @Ignore
    public OperationParams() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public boolean isEmpty() {
        return isEmpty;
    }

    public void setEmpty(boolean empty) {
        isEmpty = empty;
    }

    public boolean isHasPressure() {
        return hasPressure;
    }

    public void setHasPressure(boolean hasPressure) {
        this.hasPressure = hasPressure;
    }

    public byte getFreq() {
        return freq;
    }

    public void setFreq(byte freq) {
        this.freq = freq;
    }

    public byte getPower() {
        return power;
    }

    public void setPower(byte power) {
        this.power = power;
    }

    public byte getPressure() {
        return pressure;
    }

    public void setPressure(byte pressure) {
        this.pressure = pressure;
    }

    public int getPressurePosition() {
        return pressurePosition;
    }

    public void setPressurePosition(int pressurePosition) {
        this.pressurePosition = pressurePosition;
    }

    public byte getDepth() {
        return depth;
    }

    public void setDepth(byte depth) {
        this.depth = depth;
    }

    public byte getReplaceElectrode() {
        return replaceElectrode;
    }

    public void setReplaceElectrode(byte replaceElectrode) {
        this.replaceElectrode = replaceElectrode;
    }

    public byte getIntermittentDischargePulse() {
        return intermittentDischargePulse;
    }

    public void setIntermittentDischargePulse(byte intermittentDischargePulse) {
        this.intermittentDischargePulse = intermittentDischargePulse;
    }

    public byte getIntermittentDischargeHighLevelPeriod() {
        return intermittentDischargeHighLevelPeriod;
    }

    public void setIntermittentDischargeHighLevelPeriod(byte intermittentDischargeHighLevelPeriod) {
        this.intermittentDischargeHighLevelPeriod = intermittentDischargeHighLevelPeriod;
    }

    public byte getIntermittentDischargeLowLevelPeriod() {
        return intermittentDischargeLowLevelPeriod;
    }

    public void setIntermittentDischargeLowLevelPeriod(byte intermittentDischargeLowLevelPeriod) {
        this.intermittentDischargeLowLevelPeriod = intermittentDischargeLowLevelPeriod;
    }

    public short getContinuousDischargePeriod() {
        return continuousDischargePeriod;
    }

    public void setContinuousDischargePeriod(short continuousDischargePeriod) {
        this.continuousDischargePeriod = continuousDischargePeriod;
    }

    public short getInterval() {
        return interval;
    }

    public void setInterval(short interval) {
        this.interval = interval;
    }

    public short getShengyucishu() {
        return shengyucishu;
    }

    public void setShengyucishu(short shengyucishu) {
        this.shengyucishu = shengyucishu;
    }

    public int getPosition() {
        return position;
    }

    public void setPosition(int position) {
        this.position = position;
    }

    public boolean isAutoNeedle() {
        return autoNeedle;
    }

    public void setAutoNeedle(boolean autoNeedle) {
        this.autoNeedle = autoNeedle;
    }

    public boolean isIntermittentMode() {
        return isIntermittentMode;
    }

    public void setIntermittentMode(boolean intermittentMode) {
        isIntermittentMode = intermittentMode;
    }

    public int getDepthPosition() {
        return depthPosition;
    }

    public void setDepthPosition(int depthPosition) {
        this.depthPosition = depthPosition;
    }

    public int getContinuousDischargePosition() {
        return continuousDischargePosition;
    }

    public void setContinuousDischargePosition(int continuousDischargePosition) {
        this.continuousDischargePosition = continuousDischargePosition;
    }
}
